package com.cqie.constant;


import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
import com.zhipu.oapi.ClientV4;

import com.zhipu.oapi.service.v4.model.*;

/**
 * 操作人: 不吃海鲜
 * 时间: 2024/12/30 20:43
 */
public class AskAiConstant {
    private static final String API_KEY = "f179604472132d01ff3e011d3b88a43b";

    private static final String API_SECRET = "Jq7SLyA0iAfKJilb";

    public static final ClientV4 client = new ClientV4.Builder(API_KEY,API_SECRET).build();

    public static final ObjectMapper mapper = defaultObjectMapper();


    public static ObjectMapper defaultObjectMapper() {
        ObjectMapper mapper = new ObjectMapper();
        mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
        mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
        mapper.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE);
        mapper.addMixIn(ChatFunction.class, ChatFunctionMixIn.class);
        mapper.addMixIn(ChatCompletionRequest.class, ChatCompletionRequestMixIn.class);
        mapper.addMixIn(ChatFunctionCall.class, ChatFunctionCallMixIn.class);
        return mapper;
    }









}
